package com.study.juc;

import org.junit.Test;

import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class TimeTest {

    public static void main(String[] args) throws Exception {
        
     System.out.println(Number.class.isAssignableFrom(Number.class));
    }
    
    public static void t1(int value) throws Exception {
        
        boolean d =true;
        
         Thread t1 = new Thread(()->{
             int i=0;

             
             System.out.println(Thread.currentThread().isInterrupted());
             while(!Thread.currentThread().isInterrupted()){
                 i++;
                 try {
                     TimeUnit.SECONDS.sleep(1L);
                     System.out.println("1"+value);
                 } catch (InterruptedException e) {
                     System.out.println(Thread.currentThread().isInterrupted());
                 }  
                 System.out.println(Thread.currentThread().getName()+""+Thread.currentThread().isInterrupted());
             }
         });
        t1.setDaemon(true);
        t1.start();


        TimeUnit.SECONDS.sleep(3L);

        System.out.println("end");
    }
    
    
    static class People {
        int age;
        String name;

        public People() {
        }

        public People(int age, String name) {
            this.age = age;
            this.name = name;
        }

        @Override
        public String toString() {
            return "People{" +
                    "age=" + age +
                    ", name='" + name + '\'' +
                    '}';
        }
    }
}
